export default{
	log(){
		console.log.apply(console,arguments);
	},
	//组件共享的ajax加载方法
	ajaxLoad : null,
	noop : function(){},
	setObjDefaultAttrs(target,defaultObj){
		for(var j in defaultObj){
	    if(target[j] === undefined){
				target[j] = defaultObj[j];
	      // comp.$set(target,j,defaultObj[j]);
	    }
	  }
	},
	paddingZero(str,len){
		len = len || 2;
  	str = str + "";
  	var strLen = str.length;
  	if(strLen >= len) return str;
  	return new Array(len - strLen + 1).join('0') + str;
	}
}

function getPromptForm(){
  const inputValue = ref('');
  const Form = (props: any,context: any) => {
    return h('form',{class: 'row',...context.attrs},
      h('div',{class: 'col'},[
        h('label',{class: 'form-label'},props.label),
        h('input',{
          class: 'form-control',
          type: 'text',
          value: inputValue.value,
          onInput(e: any){
            inputValue.value = e.target.value;
          }
        }),
        h('div',{class: 'invalid-feedback',style: `display:${inputValue.value ? 'none' : 'block'}`},"请输入信息")
      ])
    );
  };
  Form.props = ['label'];
  return Form;
}